package com.iodemo;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Properties;

public class ReadPropertiesTestTrue {
    public static void main(String[] args) {
        InputStream is = null;
        InputStreamReader isr = null;
        BufferedReader br = null;

        try {
            is = ReadPropertiesTestTrue.class.getClassLoader().getResourceAsStream("info.properties");
            isr = new InputStreamReader(is);
            br = new BufferedReader(isr);


            Properties properties = new Properties();
            properties.load(is);
            String name = properties.getProperty("name");
            String age = properties.getProperty("age");
            String sex = properties.getProperty("sex");

            System.out.println(name);
            System.out.println(age);
            System.out.println(sex);

        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            IOUntilsDemo.close(br);
            IOUntilsDemo.close(isr);
            IOUntilsDemo.close(is);
        }
    }
}
